<?php
use Illuminate\Http\Request;

// Route::middleware('auth:api')->get('/user', function (Request $request) {
//     return $request->user();
// });

$api = app('Dingo\Api\Routing\Router');

$api->version('v1', [
    'namespace' => 'App\Http\Controllers\Api'
], function($api) {
    // 短信验证码
    $api->post('verificationCodes', 'VerificationCodesController@store')
        ->name('api.verificationCodes.store');


    // ### 小程序
    $api->post('riddles/userinfo', 'MiniProgramRiddlesController@userInfo')
        ->name('api.miniprogramlantern.userinfo');
    $api->post('riddles/saveuserinfo', 'MiniProgramRiddlesController@saveUserInfo')
        ->name('api.miniprogramlantern.saveuserinfo');
    $api->post('riddles/questionbank', 'MiniProgramRiddlesController@questionBank')
        ->name('api.miniprogramlantern.questionbank');
});

$api->version('v2', function($api) {
    $api->get('version', function() {
        return response('this is version v2');
    });
});